<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 垂直居中1 */
      /*   div{
            background-color: red;
            height: 100px;
            text-align: center;
        }
        span{
         
            line-height: 100px;
        } */
        /* 垂直居中2 */
     /*    div{
            background-color: red;
            height: 100px;
            width: 300px;
            display: table-cell;
            vertical-align: middle;
            text-align: center;
        } */
        /* 垂直居中3 */
        /* div{
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: red;
            height: 100px;
        } */
        /* 垂直居中4 */
        /* div{
            width: 100px;
            height: 100px;
            position: relative;
            background-color: red;
        }
        span{
            position:absolute;
            top: 50%;
            left: 50%;
            width: 50px;
            height: 50px;
            margin-top: -25px;
            margin-left: -25px;
        } */
        /* 垂直居中5 */
    </style>
</head>
<body>
    <div>
        <button type="button" onclick="window.location.href='./index.html'"></button>
        <span>垂直居中</span>
    </div>
</body>

</html>